﻿using System.Web.Mvc;
using AndrewSiemer.KnowledgeExchange.Core;
using StructureMap;


namespace AndrewSiemer.KnowledgeExchange.Web.Controllers
{
    [HandleError]
    public class HomeController : Controller
    {
        private IPostService _postService;
        public HomeController(IPostService postService)
        {
            _postService = postService;
        }

        public ActionResult Index()
        {
            ViewData["Message"] = "Welcome to ASP.NET MVC!";

            ViewData["Posts"] = _postService.GetAllPosts();

            return View();
        }
    }
}